/**
 * 队列
*/
class Node {
    constructor (data) {
        this.data = data;
        this.next = null;
    }
}

class Queue {
    constructor (data) {
        const node = new Node(data);
        this.head = node;
        this.tail = node;
        this.count = 0;
        // return this.head;
    }
    // 入队
    enQueue (data) {
        const node = new Node(data);
        this.tail.next = node;
        this.tail = node;
        this.count++;
    }
    // 出队
    deQueue () {
        this.head = this.head.next;
        this.count--;
    }
    // 判断是否已满
    isFull () {}
    // 队列大小
    size () {
        return this.count;
    }
}
const queue = new Queue(1);
queue.enQueue(2);
queue.enQueue(3);
queue.enQueue(4);
queue.enQueue(5);

queue.deQueue();

queue.enQueue(1);

console.log(queue.size());